package com.goodwilldd.base.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.goodwilldd.base.entities.Person;
import com.goodwilldd.base.repository.PersonRepository;
import com.goodwilldd.base.services.PersonService;

@Service
public class RepositoryPersonService implements PersonService {

	@Autowired
	PersonRepository personRepository;

	@Override
	public List<Person> findAll() {
		return personRepository.findAll();
	}

	@Override
	public List<Person> findByLastnameIgnoreCase(String searchTerm) {
		return personRepository.findByLastNameIgnoreCase(searchTerm);
	}
}
